package com.smmisia.article.entity.convetor;

import com.smmisia.article.dto.response.UserInfoDTO;
import com.smmisia.article.dto.response.UserResDTO;
import com.smmisia.article.dto.user.UserVO;
import com.smmisia.article.entity.User;
import org.mapstruct.Mapper;
import org.mapstruct.NullValueCheckStrategy;
import org.mapstruct.factory.Mappers;

/**
 * 用户转换器
 * @author smmisia
 * @date 2023/7/27
 */
@Mapper(nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface UserConvertor {

    UserConvertor INSTANCE = Mappers.getMapper(UserConvertor.class);

    public static final int DEFAULT_MIN_SALE_TIME = 60;

    /**
     * 转为UserDTO
     * @param user
     * @return
     */
    public UserVO mapToUserVO(User user);

    UserInfoDTO mapToUserInfoDTO(User user);

    UserResDTO mapToUserResDTO(User user);

}
